<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>apply</title>
  </head>
  <body>
    <script>
      function bind(fn, thisArg) {
        return function wrap() {
          console.log(arguments);
          var args = new Array(arguments.length);
          for (var i = 0; i < args.length; i++) {
            args[i] = arguments[i];
          }
          return fn.apply(thisArg, args);
        };
      }

      function show() {
        console.log(this.document);
      }

      let fn1 = bind(show, window);
      fn1(1, 2, 3);
    </script>
  </body>
</html>
